﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using VK.Comm;
using System.Web.UI;

namespace VK.Casemeet.Merchants.Shops
{
    public class SearchUrlEntity
    {
        private int _type = 0;
        /// <summary>
        /// 类型
        /// </summary>
        public int type
        {
            set { _type = value; }
            get { return _type; }
        }

        private int _pro = 0;
        /// <summary>
        /// 省编号
        /// </summary>
        public int pro
        {
            set { _pro = value; }
            get { return _pro; }
        }

        private string _keyword = string.Empty;
        /// <summary>
        /// 名称查找
        /// </summary>
        public string keyword
        {
            set { _keyword = value; }
            get { return _keyword; }
        }

        private int _sort = 1;
        /// <summary>
        /// 排序方法
        /// </summary>
        public int sort
        {
            set { _sort = value; }
            get { return _sort; }
        }

        private string _path = "/ShopList.html";
        /// <summary>
        /// 相对路径
        /// </summary>
        public string path
        {
            set { _path = value; }
            get { return _path; }
        }

        public string ToUrlString()
        {
            StringBuilder urlhtml = new StringBuilder();

            urlhtml.Append(_path)
                .Append("?type=").Append(_type)
                .Append("&pro=").Append(_pro)
                .Append("&keyword=").Append(HttpUtility.UrlEncode(_keyword))
                .Append("&sort=").Append(_sort);

            return urlhtml.ToString();
        }

        /// <summary>
        /// 复制对象
        /// </summary>
        /// <returns>返回它本身的一个副本</returns>
        public object GetCopy()
        {
            return MemberwiseClone();
        }
    }
}
